from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token
from rest_framework.routers import DefaultRouter

from users import views
from users.views import AddressViewSet

urlpatterns = [
    url(r'usernames/(?P<username>\w{5,20})/count/$', views.UsernamecountView.as_view()),
    url(r'mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.UsermobilecountView.as_view()),
    url(r'^users/$', views.UserView.as_view()),
    url(r'^authorizations/$', obtain_jwt_token),
    url(r'^user/$', views.UserDetailView.as_view()),
    url(r'^email/$', views.EmailView.as_view()),
    url(r'^emails/verification/$', views.EmailVerifyView.as_view()),
    url(r'^browse_histories/$', views.HistoryView.as_view()),

]

router = DefaultRouter()
router.register('addresses', AddressViewSet, basename='addresses')

urlpatterns += router.urls
